<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>字符串大小写转换</title>
</head>
<body>
    <script>
        document.write("原字符串为：www.jb51.ITCASE.CN");
        var str=['w','w','w','.','j','b','5','1','.','I','T','C','A','S','E','.','C','N']
        function toLocaleUpper(){
            var arr=[];
            for(i=0;i<=str.length;i++){
                document.write((str[i].charCodeAt(0)-32));
                String.fromCharCode(str[i].charCodeAt(0)-32)       
            }
           /* for(j=0;j<=arr.length;j++){
                document.write(arr[j])
            }*/
        }
        function toLowerCase(){
            for(i=0;i<=str.length;i++){
                document.write(str[i].charCodeAt(0)+32);
            }
        }
        toLocaleUpper();
    </script>
</body>
</html>